﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace ST.Common.Util
{
	public class EntityNotFoundException : Exception
	{
		/// <summary>
		/// 错误代码
		/// </summary>
		public int ErrorCode { get; set; }

		/// <summary>
		/// 表名
		/// </summary>
		public string TableName { get; set; }

		/// <summary>
		/// 实体查询ID
		/// </summary>
		public object ID { get; set; }

		public EntityNotFoundException() : base()
		{
		}

		public EntityNotFoundException(string msg) : base(msg)
		{
		}

		public EntityNotFoundException(string msg, object id, string tableName) : base(msg)
		{
			ID = id;
			TableName = tableName;
		}

		public EntityNotFoundException(string msg, object id) : base(msg)
		{
			ID = id;
		}

		public EntityNotFoundException(string msg, Exception innerException) : base(msg, innerException)
		{
		}

		public EntityNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
		{
		}
	}
}
